<?php
namespace App\Http\Controllers;

use App\Models\Washroom;
use Illuminate\Support\Facades\Schema;

class WashroomController extends WxBaseController{
    protected $except=['index','show'];
    public function index(){
        $wcs = Washroom::get();
        editImageUrl($wcs);
        return $this->apiReturn(true,'success',$wcs);
    }
    public function show($id){
        $wc = Washroom::where('id',$id);
        //更新浏览量
        if(Schema::hasColumn('washrooms', 'watch')){
            $wc->increment('watch');
        };
        $arr=$wc->get();
        editImageUrl($arr);
        return $this->apiReturn(true,'success',$arr);
    }
}